<%-- 
    Document   : courseSignup_Stude
    Created on : Jun 30, 2011, 12:49:24 PM
    Author     : Tyler Powell
--%>
<%@page import="java.util.ArrayList"%>
<jsp:useBean id="courseData" scope="application" class="edu.gatech.gellinservlet.model.CourseManager" />
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
    <head>
        <link rel="stylesheet" type="text/css" href="style.css"/>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>Select Courses for Lab- Lab Assistant Pro</title>
    </head>
    <body>
        <%@include file="pro_header.jsp" %>
        <%@include file="stude_list.jsp" %>
    <center>
        <h1>Select a course!</h1>
    </center>
    <table ALIGN="center" border="1" cellspacing="0" cellpadding="0">
        <form action="getLab4Team.jsp" method="post">
            <tbody>
                <tr>
                    <td>Course:</td>
                    <td>
                        <% //make an option list of all courses the student is not signed up for
                            int count = 0;
                            Student aStudent = (Student)session.getAttribute("persistUser");
                            String output = "<select name=\"course\">";
                            for (Course aCourse : aStudent.getCourseList())
                            {
                                    count++;
                                    String name = aCourse.getName();
                                    output += ("<option value=\"" + name + "\">");
                                    output += (name);
                                    output += ("</option>");
                                
                            }
                            if (count == 0)
                            {
                                output = "You have to sign up for a course before you can form/sign up for teams.";
                            } else
                            {
                                output += "</select>";
                            }
                            out.println(output);
                        %>

                    </td>
                </tr>
                <tr>
                    <td><input type="submit" value="Submit" name="signup" 
                               <% if (count == 0)
                                   {
                                       out.println("disabled=\"\"");
                                   }
                               %>/>
                        </input></td>
                </tr>
            </tbody>
        </form>
    </table>
                   
    
    <% } //ends user_redirect else statement, html is included here %>
    <% } //ends verifySession.jsp, all html is included in else statment %>
</body>
</html>
